package com.test.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.inject.Inject;
import java.util.List;
import java.util.Map;
public class People {
    /*@Autowired*/
    /*@Resource*/
    @Inject
    Rice rice;
    String name;
    List<Rice> rices;
    List<String> names;
    Map<String, Rice> maps;
    Rice[] arrays;
 public People() {

    }
    public void eat() {
        /*System.out.println("---"+rices.size());
        for (Rice s:rices){
            System.out.println("---"+s);
        }
        System.out.println("---"+maps);
        System.out.println("---"+arrays.length);*/
        rice.showName();
        System.out.println(name);
    }

    public People(int age, String name) {
        System.out.println("people----------------------");
    }

    public Rice[] getArrays() {
        return arrays;
    }

    public void setArrays(Rice[] arrays) {
        this.arrays = arrays;
    }

    public Map<String, Rice> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Rice> maps) {
        this.maps = maps;
    }


    public People(Rice rice) {
        System.out.println("people-------Rice---------------");
        this.rice = rice;

    }


    public List<Rice> getRices() {
        return rices;
    }

    public void setRices(List<Rice> rices) {
        this.rices = rices;
    }

    public List<String> getNames() {
        return names;
    }

    public void setNames(List<String> names) {
        this.names = names;
    }

    public Rice getRice() {
        return rice;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("setter name------------------");
        this.name = name;
    }
    @Resource
    @Qualifier("eggRice")
    public void setRice(Rice rice) {
        System.out.println("setter rice------------------");
        this.rice = rice;
    }
}
